package com.york.jobmew.circle.server.config.sensitive;

import com.york.jobmew.circle.server.sensitive.WordContext;
import com.york.jobmew.circle.server.sensitive.WordFilter;
import com.york.jobmew.circle.server.service.SensitiveWordsService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * dfa算法实现敏感词分析的配置
 * 注册敏感词过滤和词库上下文环境
 */
@Configuration
public class SensitiveConfig {

    @Bean
    public WordContext wordContext(SensitiveWordsService service) {
        return new WordContext(true, service);
    }

    @Bean
    public WordFilter wordFilter(WordContext wordContext) {
        return new WordFilter(wordContext);
    }

}
